//
//  HelpCenterCell.swift
//  AcrossAnHui
//
//  Created by 张继强 on 16/11/17.
//  Copyright © 2016年 安徽畅通行. All rights reserved.
//

import UIKit

class HelpCenterCell: UITableViewCell {
    var model:HelpCenterModel?{
        didSet{
            //布局
//            self.infoLabel?.text = "新世界天尊" 
            self.infoLabel?.text = self.model?.content
//            self.infoLabel?.lineSpace = 11
//            self.infoLabel?.numberOfLines = 0
//            let rect:CGRect = (self.infoLabel?.getLableHeight(withMaxWidth: self.contentView.bounds.width-25.0))!
//            self.infoLabel?.snp.makeConstraints({ (make) in
//                make.left.equalTo(12.5)
//                make.right.equalTo(-12.5)
//                make.height.equalTo(rect.height)
//                make.top.equalTo(15)
//            })
        }
    }
    override func layoutSubviews() {
        super.layoutSubviews()
        self.infoLabel?.lineSpace = 0
        self.infoLabel?.numberOfLines = 0
        let height:CGFloat = (self.infoLabel?.jqGetHeightWithstr(self.infoLabel?.text ?? "", withfontSize: 14, withLineSpace: 0, withmaxWidth: k_Wide - 32))!
        self.infoLabel?.snp.makeConstraints({ (make) in
            make.left.equalTo(16)
            make.right.equalTo(-16)
            make.height.equalTo(height)
            make.top.equalTo(12)
        })
    }
    var infoLabel:UILabel? = UILabel.init()
    var shawDownView:UIView = UIView.init()
    override func awakeFromNib() {
        super.awakeFromNib()
    }
    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)
    }
    
    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        self.contentView.addSubview(self.infoLabel!)
        self.contentView.addSubview(self.shawDownView)
        self.shawDownView.snp.makeConstraints { (make) in
            make.left.equalTo(0)
            make.right.equalTo(0)
            make.bottom.equalTo(0)
            make.height.equalTo(0.5)
        }
        self.shawDownView.backgroundColor = .lightGray
        self.infoLabel?.textColor = .lightGray
        self.infoLabel?.font = UIFont.systemFont(ofSize: 14)
//        self.contentView.backgroundColor = UIColor.init(colorLiteralRed: 200/255.0, green: 200/255.0, blue: 200/255.0, alpha: 1)
        self.contentView.backgroundColor = .white
    }
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
    }

}
